package com.dji.activationDemo.websocket;

import android.app.Application;
import android.content.Context;

import dji.log.third.Logger;

public class WsApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        initAppStatusListener();
    }

    private void initAppStatusListener() {
        ForegroundCallbacks.init(this).addListener(new ForegroundCallbacks.Listener() {
            @Override
            public void onBecameForeground() {
                Logger.t("WsManager").d("应用回到前台调用重连方法");
                WsManager.getInstance().reconnect();
            }

            @Override
            public void onBecameBackground() {

            }
        });
    }
}
